//
//  WBDemoViewController.swift
//  swiftweibo
//
//  Created by ffxk007 on 2017/6/15.
//  Copyright © 2017年 ffxk007. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        title = "第 \(String(describing: navigationController?.childViewControllers.count ?? 0)) 个"
    }
    
    @objc fileprivate func showNext(){
        let vc = WBDemoViewController()
        navigationController?.pushViewController(vc, animated: true)
        
    }
   
}

extension WBDemoViewController{
    
    override func setupTableview() {
        super.setupTableview()
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
//    override func setupUI() {
//        super.setupUI()
//        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
//        let btn:UIButton = UIButton()
//        btn.frame = CGRect(x: 0, y: 0, width: 50, height: 50)
//        btn.titleLabel?.font = UIFont.systemFont(ofSize: 16)
//        btn.setTitle("下一个", for: UIControlState.normal)
//        btn.setTitleColor(UIColor.darkGray, for: UIControlState.normal)
//        btn.setTitleColor(UIColor.orange, for: UIControlState.highlighted)
//        btn.addTarget(self, action: #selector(showNext), for: .touchUpInside)
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn)
        
//    }
}
